<template>
	<div>
		<el-form v-model="entityQueryForm">
			<el-row> style="display:flex;justity-content:center;align-items:center;margin-bottom: 15px;"
				<el-col :span="3">
					<i class="el-icon-arrow-left" @click="goHome"></i>
				</el-col>
				<el-col :span="18">
					<el-input v-model="entityQueryForm.id" @change="getEntityListByPage" size="mini"></el-input>
				</el-col>
				<el-col :span="4">
					<i @click="showAddEntityDialogHandler" class="el-icon-plus"></i>
				</el-col>
			</el-row>
		</el-form>
		<el-dialog :visible.sync="showEntityDialog" v-if="showEntityDialog" fullscreen :modal="false">
			<el-form :model="entity" label-width="75px" size="mini">
				<el-form-item label="账号">
					<el-input v-model="entity.accountNumber"></el-input>
				</el-form-item>
				<el-form-item label="年龄">
					<el-input v-model="entity.age"></el-input>
				</el-form-item>
				<el-form-item label="余额">
					<el-input v-model="entity.balance"></el-input>
				</el-form-item>
				<el-form-item label="性别">
					<el-input v-model="entity.gender"></el-input>
				</el-form-item>
				<el-form-item label="firstname">
					<el-input v-model="entity.firstname"></el-input>
				</el-form-item>
				<el-form-item label="lastname">
					<el-input v-model="entity.lastname"></el-input>
				</el-form-item>
				<el-form-item label="邮箱">
					<el-input v-model="entity.email"></el-input>
				</el-form-item>
				<el-form-item label="职位">
					<el-input v-model="entity.employer"></el-input>
				</el-form-item>
				<el-form-item label="所在城市">
					<el-input v-model="entity.city"></el-input>
				</el-form-item>
				<el-form-item label="地址">
					<el-input v-model="entity.address"></el-input>
				</el-form-item>
				<el-form-item label="状态">
					<el-input v-model="entity.state"></el-input>
				</el-form-item>
			</el-form>
			<div style="text-align: center">
				<el-button @click="entityDialogConfirm" size="mini">确定</el-button>
			</div>
		</el-dialog>
		<el-card style="text-align: left" v-for="item in entityList">
			<el-row>
				<el-col :span="22">
					<div v-if="isNotEmpt(item.accountNumber)">账号:{{ item.accountNumber }}</div>
					<div v-if="isNotEmpt(item.age)">年龄:{{ item.age }}</div>
					<div v-if="isNotEmpt(item.balance)">余额:{{ item.balance }}</div>
					<div v-if="isNotEmpt(item.gender)">性别:{{ item.gender }}</div>
					<div v-if="isNotEmpt(item.firstname)">firstname:{{ item.firstname }}</div>
					<div v-if="isNotEmpt(item.lastname)">lastname:{{ item.lastname }}</div>
					<div v-if="isNotEmpt(item.email)">邮箱:{{ item.email }}</div>
					<div v-if="isNotEmpt(item.employer)">职位:{{ item.employer }}</div>
					<div v-if="isNotEmpt(item.city)">所在城市:{{ item.city }}</div>
					<div v-if="isNotEmpt(item.address)">地址:{{ item.address }}</div>
					<div v-if="isNotEmpt(item.state)">状态:{{ item.state }}</div>
				</el-col>
				<el-col :span="2" style="text-align: right">
					<div><i class="el-icon-edit-outline" @click="showUpdateEntityDialogHandler(null, item)"></i></div>
					<div><i class="el-icon-minus" @click="deleteEntity(null, item)" style="margin-top: 5px"></i></div>
				</el-col>
			</el-row>
		</el-card>
		<el-pagination
			@size-change="sizeChangeHandle" @current-change="currentChangeHandle"
			layout="total, sizes, prev, next" :current-page="currentPage"
			:page-sizes="[10,15,30,50]" :page-size="pageSize" :total="total">
		</el-pagination>
	</div>
</template>
<script>
	import Mixin4Curd from "../../Mixin4Curd";
	export default {
		name: "Account",
		mixins: [Mixin4Curd],
		data: function () {
			return {
				entityName4LowerCamel:'account',
				entityName4UpperCamel:'Account',
				primaryKey:'accountNumber',
			}
		},
		methods: {
		},
	}
</script>
<style>

</style>
